package com.ojoin.ojoin.eb_spider.service;

import org.springframework.stereotype.Service;

import com.ojoin.ojoin.eb_spider.domain.EmailMessage;

/**
 * 
 * 
 * @author zwc
 * 
 */
@Service
public interface EmailMessageService {

	
	/**
	 * 发送邮件报告
	 * @param emailMessage
	 * @return
	 */
	public boolean sendMail( EmailMessage  emailMessage);

	/**
	 * 发送监控邮件
	 * @param emailMessage
	 * @return
	 */
	public boolean sendMailMonitoring( EmailMessage  emailMessage);
	
	
	
	/**
	 * 发送缓存邮件给监控者
	 * @return
	 */
	public boolean sendMailMonitoring(String username);
	

	/**
	 * 发送缓存邮件给监控者
	 * @return
	 */
	public boolean sendMailException(EmailMessage  emailMessage);
	

	/**
	 * 生成html
	 * 代码 监控
	 * 
	 * @param lists
	 * @return
	 */
	public String getHtmlMonitoring(EmailMessage  emailMessage);
	
	/**
	 * 生成html
	 * 代码 报告
	 * 
	 * @param lists
	 * @return
	 */
	public String getHtmlReport(EmailMessage  emailMessage);
	
	

	/**
	 * 生成html
	 * 代码带系统错误
	 * 
	 * @param lists
	 * @return
	 */
	
	public String getHtmlReport(EmailMessage  emailMessage,boolean sys);
	
	/**
	 * 保存邮件到缓存
	 * @param emailMessage
	 */
	public void save(EmailMessage  emailMessage);

	/**
	 * 问题解决之后移除缓存邮件
	 * @param emailMessage
	 */
	
	public void remove();
	
	/**
	 * 从缓存中获取待发送邮件
	 * @return
	 */
	public EmailMessage getCache(String username);
	
	
	/**
	 * 判断邮件是否发送，与缓存中已发送邮件比较
	 * @param emailMessage
	 * @return
	 */
	public boolean isSend(EmailMessage  emailMessage);
	
	
	public boolean hasException(EmailMessage  emailMessage);
	
	public String getException(EmailMessage  emailMessage);
	
	
	
}
